package com.wj.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RagConfig {
    @Autowired
    private ChatClient.Builder builder;
    @Value("${chatbot.system-prompt}")
    private String systemPrompt;
    @Bean
    public ChatClient chatClient() {
        return builder
                .defaultSystem(systemPrompt)
                .build();
    }
//    @Bean
//    ChatClient chatClient(ChatClient.Builder builder) {
//        //定义一个ai角色描述，作为ai的初始角色描述
//        return builder.defaultSystem("你将作为一名房东，回复租客要求")
//                .build();
//    }
}
